#ifndef ABSCENCES_H
#define ABSCENCES_H

#include "ui_abscences.h"
#include <QDialog>
#include <QtGui>


#include <QSqlError>
#include <QSqlQuery>
#include <QSqlDatabase>

#include <QCompleter>

class Dialog : public QDialog, private Ui::Abscences
{
    Q_OBJECT

public:
    Dialog(QWidget *parent );
    QList <QString> dates,raisons,duree;

    void retrive(QList <QString> dates,QList <QString> raisons);
    void setCin(QString curCin,QString name,double curSal);
    void setMonth(const QDate & min, const QDate & max );
    void calcAbsCost();
    double calcAbsNbr();
    void calcSal();
    void saveChanges();


public slots:
    void hidePanel();
    void addAbs();
    void remAbs();
    void showAbs(int year, int month);
    void setDate(QDate date);
    void calcJour(double baseSal);
    void updateSal(double ret);
    void updateSal();
    void setSel(QModelIndex ind);
    void save();

    void setEdit(bool state);
    void clearTable();


private:

    QString curcin;
    double curSal;
    QString curName;
    QDate curDate;
};

#endif
